import * as THREE from "three"
import r from "../shader/31090"
import o from "../shader/69383"
import ae from "../shader/54124"
import be from "../shader/59253"
import ce from "../shader/25247"
import de from "../shader/84294"
import ee from "../shader/10982"
import fe from "../shader/96432"
import ge from "../shader/27409"
import he from "../shader/24074"
import ie from "../shader/57971"
import je from "../shader/40933"
import funcUtil from "../utils/func.util"
import meshEnum from "../enum/mesh.enum"
export const meshTrimsLength = 10
export const ShaderConfig = {
  cube: {
    uniforms: {
      map: { type: "t", value: null },
      opacity: { type: "f", value: 1 }
    },
    vertexShader: funcUtil.addNR(o, ae),
    fragmentShader: funcUtil.addNR(r, be)
  },
  blurCube: {
    uniforms: {
      map: { type: "t", value: null },
      opacity: { type: "f", value: 1 },
      dir: { type: "v2", value: new THREE.Vector2(0, 0) }
    },
    vertexShader: funcUtil.addNR(o, ce),
    fragmentShader: funcUtil.addNR(r, de)
  },
  modelChunk: {
    uniforms: {
      [meshEnum.MeshTexture]: {
        map: { type: "t", value: null },
        meshOpacity: { type: "f", value: 0 },
        opacity: { type: "f", value: 1 },
        transparentDiscardDist: { type: "f", value: 0 }
      },
      [meshEnum.MeshTrim]: {
        meshTrimPositions: { type: "v3array", value: [] },
        meshTrimScales: { type: "v3array", value: [] },
        meshTrimsEnabled: {
          type: "barray",
          value: new Array(meshTrimsLength).fill(!1)
        }
      },
      [meshEnum.PanoTexture]: {
        pano0Map: { type: "t", value: null },
        pano0Position: { type: "v3", value: new THREE.Vector3() },
        pano0Matrix1: { type: "m4", value: new THREE.Matrix4() },
        pano0Matrix2: { type: "m4", value: new THREE.Matrix4() },
        panoOpacity: { type: "f", value: 1 }
      },
      [meshEnum.PanoTextureTransition]: {
        progress: { type: "f", value: 0 },
        pano1Map: { type: "t", value: null },
        pano1Position: { type: "v3", value: new THREE.Vector3() },
        pano1Matrix1: { type: "m4", value: new THREE.Matrix4() },
        pano1Matrix2: { type: "m4", value: new THREE.Matrix4() }
      },
      [meshEnum.PanoOverlay]: {
        overlay0Map: { type: "t", value: null },
        overlay0Matrix: { type: "m4", value: new THREE.Matrix4() }
      },
      [meshEnum.PanoOverlayTransition]: {
        overlay1Map: { type: "t", value: null },
        overlay1Matrix: { type: "m4", value: new THREE.Matrix4() }
      },
      [meshEnum.ColorOverlay]: {
        colorOverlay: { type: "v4", value: null }
      },
      [meshEnum.MeshPreviewSphere]: {
        meshPreviewCenter: { type: "v3", value: null },
        meshPreviewSize: { type: "f", value: 0.3 }
      },
      [meshEnum.Wireframe]: {
        time: { type: "f", value: 0 },
        fill: { type: "c", value: new THREE.Color(16711680) },
        stroke: { type: "c", value: new THREE.Color(16777215) },
        dualStroke: { type: "b", value: !1 },
        fillEnabled: { type: "b", value: !1 },
        insideAltColor: { type: "b", value: !1 },
        thickness: { type: "f", value: 0.1 },
        secondThickness: { type: "f", value: 0.1 },
        dashEnabled: { type: "b", value: !1 },
        dashRepeats: { type: "f", value: 10 },
        dashOverlap: { type: "b", value: !1 },
        dashLength: { type: "f", value: 0.1, range: [0, 1] },
        dashAnimate: { type: "b", value: !1 },
        squeeze: { type: "b", value: !1 },
        squeezeMin: { type: "f", value: 0.1 },
        squeezeMax: { type: "f", value: 1 },
        wireframeOpacity: { type: "f", value: 1, range: [0, 1] }
      }
    },
    vertexShader: funcUtil.addNR(o, ie),
    fragmentShader: funcUtil.addNR(r, je)
  },
  modelOutside: {
    uniforms: {
      map: { type: "t", value: null },
      opacity: { type: "f", value: 1 },
      colorOverlay: { type: "v4", value: new THREE.Vector4(0, 0, 0, 0) }
    },
    vertexShader: funcUtil.addNR(o, ee),
    fragmentShader: funcUtil.addNR(r, fe)
  },
  depth: {
    uniforms: {
      opacity: { type: "f", value: 1 },
      maxDistance: { type: "f", value: 20 }
    },
    vertexShader: funcUtil.addNR(o, ge),
    fragmentShader: funcUtil.addNR(r, he)
  }
}
